from po_login.Base import Base
from selenium.webdriver.common.by import By

class Page(Base):

    # 定位器
    # 定位登录文本
    login_text = (By.LINK_TEXT,'登录')
    # 封装点击登录文本
    def click_text(self):
        self.click(self.login_text)
    # 定位账号输入框
    user_input = (By.NAME,'username')
    # 封装输入账号
    def send_user(self):
        self.send_keys(self.user_input,'15523615757')
    # 定位密码输入框
    pwd_input = (By.NAME,'password')
    # 封装输入密码
    def send_pwd(self):
        self.send_keys(self.pwd_input,'123456')
    # 定位登录按钮
    login_button = (By.CLASS_NAME,'finish-btn')
    # 封装点击登录按钮
    def click_button(self):
        self.click(self.login_button)
    # 定位搜索框
    search_input = (By.CLASS_NAME,'search-input')
    # 封装输入搜索框
    def send_search(self):
        self.send_keys(self.search_input,'手机AAAAA')
    # 定位搜索按钮
    search_button = (By.XPATH,'//*[@id="searchForm"]/div[2]/input')
    # 封装点击搜索按钮
    def click_search(self):
        self.click(self.search_button)